package com.srq.dao.impl;

import com.srq.dao.UserDao;
import com.srq.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class UserDaoimpl implements UserDao {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    public List<User> findAllUser(){
        List<User> userList = jdbcTemplate.query("select * from zq.user", new BeanPropertyRowMapper<User>(User.class));
        return userList;
    }
}
